package leetcode_601_700;

public class LeeCode_680 {
    public static void main(String[] args) {

    }
    private static boolean validPalindrome(String s) {
        int n = s.length();
        int l = 0, r = n - 1;
        while (l < r){
            if (s.charAt(l) != s.charAt(r)){
                return charge(s.substring(l + 1, r + 1)) || charge(s.substring(l, r));
            }
            l++;
            r--;
        }
        return true;
    }
    private static boolean charge(String s){
        int l = 0, r = s.length() - 1;
        while (l < r){
            if (s.charAt(l) != s.charAt(r))
                return false;
            l++;
            r--;
        }
        return true;
    }
}
